<!-- 投保记录 - 综合表单页面 -->
<template>
  <div class="page-container">
    <page_breadcrumb :getKeyMethod="init_table_model" @change="change_table_model" pageOption />
    <ex_super_table_page v-bind="option" ref="SuperTablePage">
    </ex_super_table_page>

    <detail_insurance_record ref="detail_insurance_record" />
  </div>
</template>
<script>
import superTablePageFunction from '@/mixin/super-table-page-function';
import page_table_model_manage from '@/mixin/page_table_model_manage';

import detail_insurance_record from './dialog/detail_insurance_record.vue';
let moduleName = "label_srm_insurance_insue_log_insurance_record"

export default {
  title: moduleName,
  mixins: [superTablePageFunction, page_table_model_manage],
  components: { detail_insurance_record },
  data() {
    return {

      option: {
        //搜索框内容
        search: {
          //搜索框内容，key为搜索字段，label为标签提示
          model: [
            { label: "label_srm_insurance_insue_log_declaration_no", key: "declareNo", type: 'input', attrs: { placeholder: '请输入', }, },
            { label: "label_srm_insurance_insue_log_insurance_no", key: "insuranceCode", type: 'input', attrs: { placeholder: '请输入', }, },
            { label: "label_srm_insurance_insue_log_policy_no", key: "policyNo", type: 'input', attrs: { placeholder: '请输入', }, },
            { label: "label_srm_insurance_insue_log_insurance_platform", key: "insurancePlatform", type: 'input', attrs: { placeholder: '请输入', }, },
            //所有元素均可添加可选attrs对象增加属性，详细属性列表由element-ui提供
          ],
        },

        table: {
          url: "/srm-api/supplier/ApiInsuranceOrderRpc/selectList.json",
          attrs: {},
          model: this.init_table_model(),
        }
        ,

      },

    };
  },
  methods: {
    option_table_model() {
      return [
        {
          type: 'expandDesc', 'width': 100,
          expandDesc: {
            class: "desc_flex_row",
            column: 4, border: true, direction: 'vertical', labelClassName: 'flex_cell', contentClassName: 'flex_cell',
            model: [],
          },
        },
        { key: 'declareNo', label: 'label_srm_insurance_insue_log_declaration_no', },
        { key: 'insurancePlatform', label: 'label_srm_insurance_insue_log_insurance_platform', },
        { key: 'insuranceCode', label: 'label_srm_insurance_insue_log_insurance_no', },
        { key: 'policyNo', label: 'label_srm_platform_policy_no', },
        { key: 'apiServiceId', label: 'label_srm_insurance_insue_log_api_service_id', keyShow: 'expandDesc', },
        { key: 'customerCode', label: 'label_srm_insurance_insue_log_customer_code', },
        { key: 'cargoWorth', label: 'label_srm_insurance_insue_log_cargo_value', },
        { key: 'premium', label: 'label_srm_platform_premium', },
        { key: 'insureNumber', label: 'label_srm_insurance_insue_log_insurance_count', },
        { key: 'insureStatus', label: 'label_srm_insurance_insue_log_insurance_status', 'width': 150, formatter: (r, c, v, i) => this.$enumShow(v, "YesOrNoEnum") },
        { key: 'insureDate', label: 'label_srm_insurance_insue_log_success_insu_date', keyShow: 'expandDesc', formatter: (r, c, v) => this.$dateFormat(v) },
        { key: 'stockinStatus', label: 'label_srm_insurance_insue_log_store_decl_status', keyShow: 'expandDesc', 'width': 150, formatter: (r, c, v, i) => this.$enumShow(v, "YesOrNoEnum") },
        { key: 'stockinDate', label: 'label_srm_insurance_insue_log_store_decl_date', keyShow: 'expandDesc', formatter: (r, c, v) => this.$dateFormat(v) },
        { key: 'inventoryStatus', label: 'label_srm_insurance_insue_log_inv_decl_status', keyShow: 'expandDesc', 'width': 150, formatter: (r, c, v, i) => this.$enumShow(v, "YesOrNoEnum") },
        { key: 'inventoryDate', label: 'label_srm_insurance_insue_log_inv_last_date', keyShow: 'expandDesc', formatter: (r, c, v) => this.$dateFormat(v) },
        {
          type: 'operate', width: 160, operate: [
            {
              label: 'label_srm_insurance_insue_log_view_insue', click: (row) => {
                this.$refs.detail_insurance_record.show({
                  params: { orderNo: row.declareNo },
                  data: row
                })
              }
            },
            {
              label: 'label_srm_insurance_insue_log_reset_insue', type: "confirm-button", url: '/srm-api/supplier/ApiInsuranceOrderRpc/reInsure.json', message: '确定要重新投保该记录吗？',
              buttonClass: "button_text_danger", confirmButtonType: 'danger', urlType: 'json',
              params: (row) => { return { "ids": [row["id"]] } }, done: ['reload', 'tip']
            },
          ],
        }
      ]
    },
  }
};

</script>
<style></style>
